#!/usr/bin/python
# -*- coding: utf8 -*-

#######################################################
## 多线程编程
#######################################################

import threading, time

def process():
    for i in range(3):
        time.sleep(20)
        print("thread name is %s" % threading.current_thread().name)


if __name__ == '__main__':
    print("--- main thread start ---")
    threads = [ threading.Thread(target=process) for i in range(4)]
    for th in threads:
        th.start()

    for th in threads:
        th.join()

    print("--- main thread end ---")